home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 13958 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.7 KB  |  43 lines

  1. Path: news.oacis.com!usenet
  2. From: Rehan Chawdry <rchawdry@oacis.com>
  3. Newsgroups: comp.lang.c,comp.lang.c++,comp.lang.basic.visual.misc
  4. Subject: Re: DLL, VB and Borland C/C++
  5. Date: Wed, 27 Mar 1996 22:11:46 -0800
  6. Organization: Oacis Healthcare Systems
  7. Message-ID: <315A2DA2.716E@oacis.com>
  8. References: <312A0334.AC5@supaero.fr> <4gfg6m$eet@hasle.sn.no> <4hagmf$qc0@donald.interpac.be> <4j5mqr$su7@ohnasn01.sinet.slb.com> <4jc1d6$2tv@news.inc.net>
  9. NNTP-Posting-Host: 147.15.2.189
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0GoldB1 (Win95; I)
  14.  
  15. Will Flor wrote:
  16.  
  17. > >>>I am trying desperatly to call a DLL created with Borland C/C++ 4.5 in a
  18. > >>>VB 3.0 application, but VB always complains about a so called "Bad
  19. > >>>Calling Convention Error". This Error message is not very documented,
  20. > >>>and Borland Help files are worth nothing, so...
  21. > >
  22. > >> Hi Sylvain.
  23. > >
  24. > >>Did you use, if necessary,  the "byval" option in your declaration
  25. > >>code?
  26. > >
  27. > >>Michel
  28. > >
  29. > >I have the same problem with VB4.0 and Visual C++ DLLs
  30.  
  31.  
  32. I don't know if this is also true, but if you are compiling with C++ and attempting to
  33. use the functions in VB, yes, you have to export them, but also suppress the C++ name 
  34. mangling for functions.  You did this via declaring all your exported functions as 
  35. 'extern "C" {}'.  If you have Windows 3.1/VC++ 1.52 you can use the EXEHDR.EXE(?) 
  36. program to list all of the functions in your .DLL.  They should be recognizable readable
  37. names (unmangled). If you have Win95,  you can just QuickView on the .DLL to find the 
  38. same information.  If they are funny names (MyFunction@@#@#!@#$#), then either use the 
  39. extern keyword, or set an option in your compiler.
  40.     
  41.     -- Rehan --
  42.